/*********************************
 * Author: Nikhil Kishore
 * Date July 11, 2014 
 * Description: Testing great_hall card
 **********************************/


#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include "rngs.h"


int main(){
	return great_halltest();
}


int great_halltest(){
	printf("Testin great_hall card\n");
	struct gameState *state = malloc(sizeof(struct gameState));
	int card = great_hall;
	int choice1, choice2, choice3, handPos;
	int bonus;
	state->whoseTurn = 1;
	state->numPlayers = 4;
	state->numActions = 1;
	int player = state->whoseTurn;
	state->whoseTurn = 1;
	int i ;
	int j;

	for (i = 0 ; i < 25; i ++){
		state->supplyCount[i] = 5;
	}
	for (i = 0 ; i < state->numPlayers ; i++){
		for ( j = 0 ; j < 25 ; j++ ){
			state->hand[i][j] = 5;
			state->discard[i][j] = 4;
			state->deck[i][j] = 3;
			state->deckCount[i] = 10;
			state->discardCount[i] = 20;
			state->handCount[i] = 7;
		}
	}
	choice1 = 1;
	choice2 = 2;
	choice3 = 3;
	handPos = 1;
	bonus = 1;

	int numActions = state->numActions;
	int handCount = state->handCount[player];
	int deckCount = state->deckCount[player];
	int discardCount = state->discardCount[player];
	if ( cardEffect( card,  choice1, choice2, choice3, state,  handPos, &bonus) == 0){
		printf("Success: cardEffect for great_hall returned 0\n");

		if (state->numActions == numActions +1){
			printf("Success: Increment numActions\n");
		} else {
			printf("Failed: increment numActions\n");
		}

		if (state->handCount[player] == handCount){
			printf("Success: handcount decrement\n");
		} else {
			printf("Failed: handcount decrement\n");
		};

		if (state->deckCount[player] == deckCount -1 ){
			printf("Success: deck decrement\n");
		} else {
			printf("Failed: deck decrement\n");
		}

		if (state->discardCount[player] == discardCount + 1){
			printf("Success: discardCount increment\n");
		} else {
			printf("Failed: discardCount increment\n");
		}

	}else {
		printf("Failed: cardEffect for great_hall didn't return 0\n");
	}
 
	

	printf("End testing great_hall card\n\n");
	return 0;
}
